<?php

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Support\JsExp;
use LowCode\Traits\Events\HasOnUpdateValue;
use LowCode\Traits\Props\HasDefaultValue;
use LowCode\Traits\Props\HasDisabled;
use LowCode\Traits\Props\HasName;
use LowCode\Traits\Props\HasSize;

/**
 * Radio组件
 * @method static static make(string|JsExp $name, string|int|bool|JsExp $value = null) RadioGroup组件
 */
class RadioGroup extends Naive
{

    use HasName, HasDisabled, HasSize, HasDefaultValue, HasOnUpdateValue;

    /**
     * @param string|int|bool|null $value
     */
    public function __construct(string|JsExp $name, string|int|bool|JsExp $value = null)
    {
        parent::__construct();
        $this->name($name)->value($value);
    }


    /**
     * 设置组件值
     * @param mixed $value
     * @return $this
     */
    public function value(string|int|bool|JsExp $value = null): static
    {
        return $this->prop('value', $value);
    }

}
